<?php
namespace app\admin\model;

use think\Model;

class Article extends Model
{
	protected $name = 'article';
    protected $type = [
        'add_time' => 'timestamp:Y-m-d H:i:s',
        'upd_time' => 'timestamp:Y-m-d H:i:s',
    ];

    // 定义时间戳字段名
    protected $addTime = 'create_at';
    protected $updTime = 'update_at';

    public function category(){
            return $this->belongsTo('Category', 'catid', 'id')->field('id,catname');
    }
}